<%@page contentType="text/html"%>
<%@page pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html >
<html>

<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>新职课JAVA学习平台-后台管理</title>
<!-- 导入主题样式 -->
<!-- <link rel="stylesheet" href="public/easyui/themes/bootstrap/easyui.css" /> -->
<link rel="stylesheet"
	href="public/easyui/themes/bootstrap/insdep/easyui.css" />
<link rel="stylesheet"
	href="public/easyui/themes/bootstrap/insdep/easyui_animation.css" />
<link rel="stylesheet"
	href="public/easyui/themes/bootstrap/insdep/easyui_plus.css" />
<!-- <link rel="stylesheet"
	href="public/easyui/themes/bootstrap/insdep/insdep_theme_default.css" /> -->
<link rel="stylesheet"
	href="public/easyui/themes/bootstrap/insdep/icon.css" />
<!-- 导入图标库 -->
<!-- <link rel="stylesheet" href="public/easyui/themes/icon.css" /> -->

<link rel="stylesheet" href="public/css/exercises.css" />
<link rel="stylesheet" href="public/css/app.css" />
<link rel="stylesheet" href="public/css/homepage.css" />
<link rel="stylesheet" href="public/css/publish.css" />
<link rel="stylesheet" href="public/css/add_payback.css" />
<link rel="stylesheet" href="public/css/payrecord_detail.css" />
<link href="public/css/stage.css" rel="stylesheet" type="text/css">
<link rel="shortcut icon" type="image/x-icon" href=" public/images/favicon.ico" media="screen" />
</head>
<body class="easyui-layout">
	<!--顶部-->
	<div data-options="region:'north'" style="height: 50px; overflow: visible; background-color: rgb(35, 44, 50);">
		<div class="top-body">
			<div class="title" style="width: 190px;	float:left;height:48px;">
				<a id="homepage">
				<img title="首页" src="public/images/homepage.png"style="margin: 6px 0px 0px 10px; float: left;"> 
				<span style="font-size: 20px;color:#fff; float: left;font-weight:bold; line-height: 48px;">学员信息管理</span>
				</a>
			</div>



			<div class="exit">
				<label> 
					
						<a style="color: white; cursor: pointer; font-size: 14px;" id="exit">
							<img src="public/images/exit.png" class="exitimg" title="退出系统">
							<span class="exittxt">退出</span>
						</a>
					
				</label>
			</div>


			<div class="password">
				<label> 
						<a style="color: white; cursor: pointer; font-size: 14px;" id="changePassword">
							<img src="public/images/password.png" class="exitimg" title="修改密码">
							<span class="exittxt">修改密码           |</span>
						</a>					
				</label>
			</div>
			
			 <div style="float: right;height: 48px;width:120px;border-radius:5px;">
					<span style="color: white;cursor: pointer; font-size: 14px;line-height: 48px;float:right;padding-right:10px;"> 
							${user.account}	   |
					</span>
			</div>
		</div>
	</div>


	<!--导航-->
	<div data-options="region:'west',title:'导航',split:false,collapsible:true" style="width: 192px; overflow-x:hidden;">
		<div id="nav" class="easyui-accordion" style="width: 190px;border:none;">
		
			<!-- 当前登录用户信息 -->
			<div title="当前用户" id="currentUser" data-options="collapsible:false" style="overflow:auto;height:150px;padding-top:10px;" >
			
				<div style="width:45px; height: 48px;float: left;margin-left:5px">
					<a id="headportrait">
					
						<c:if test="${empty user.images}">
							<img src="public/images/mo.jpg"  title="${user.name}" class="touxiang" />
						</c:if>
						<c:if test="${not empty  user.images}">
							<img src="public/images/${user.images.path}"  title="${user.name}" class="touxiang" />
						</c:if>
							
					</a>
        		</div>
        		
        		
        		<div style="width:125px; height: 48px;float: left;margin-left:5px;">
	        		<div  style="width: 130px;float:left;">
	        				<input type="hidden" id="userid" value="${user.id }">
		        			<span style="font-size:14px;font-weight: bold;float:left;margin-top:5px;color:RGB(64,72,91)">${user.name}</span>
		        			<a id="edituser">
		        				<img src="public/images/xiugai.png" id="xiugai" title="编辑当前用户" style="margin:5px 10px 0px 0px;float:right;cursor: pointer;">
	        				</a>
	        		</div>
	        		<div  style="width:130px;height:20px;margin-top:5px;float:left;">
						<span style="font-size:12px;float:left">${user.emp.job}</span>
						
	        		</div>
        		</div>
        		
        		<div  style="width:100%;float:left;height:30px;text-align: center;padding-top:5px;">
        			
        			<div style="float:left;margin-left:5px;width:80px;height:30px;">
        				<a id="wodexiaoxi" >
        					<span style="font-size:12px;line-height: 30px;cursor: pointer;" >我的消息(
        					<span id="wdxx">
        					<c:if test="${count==null || count==0 }">
        						0
        					</c:if>
        					<c:if test="${count>0 }">
        					<span style="color:red;font-weight:bold;">${count}</span>
        					</c:if>
        					</span>
        					</span>)	
        						
        				</a>
        			</div>
        			
        			<div style="margin-left:10px;float:left;width:80px;height:30px;">
        				<a>
        					<span  id="yjmassage"  style="font-size:12px;line-height: 30px;cursor: pointer;">我的提醒(
        					<span id="wdtx">
        					
        					<c:if test="${t==null || t==0 }">
        						0
        					</c:if>
        					<c:if test="${t>0 }">
        					<span style="color:red;font-weight:bold;">${t}</span>
        					</c:if>
        					</span>
        					</span>)	
        				</a>
        			</div>
        		</div>
        		
        	</div>	
        	
			<div title="系统设置" data-options="iconCls:'icon-system'"
				style="overflow: auto; padding: 2px;"  >
				<ul id="menu-xt" class="easyui-tree">
					<li data-options="url:'dept',iconCls:'icon-dept'">部门管理</li>
					<li data-options="url:'emp',iconCls:'icon-user_manager'">员工管理</li>
					<li data-options="url:'user',iconCls:'icon-user_manager'">用户管理</li>
					<li data-options="url:'role',iconCls:'icon-role'">角色管理</li>
					<li data-options="url:'resources',iconCls:'icon-dept'">权限管理</li>
				</ul>
			</div>

			<div title="招生管理" data-options="iconCls:'icon-zhaosheng'"
				style="overflow: auto; padding: 2px;">
				<ul class="easyui-tree" id="menu-zs">
					<li data-options="url:'recruit_students',iconCls:'icon-recruit_students'">全部咨询</li>
					<li data-options="url:'myrecruit_students',iconCls:'icon-recruit_students'">我的咨询</li>
					<li data-options="url:'distribution',iconCls:'icon-recruit_students'">分配记录</li>
					<li data-options="url:'follow_uppage',iconCls:'icon-recruit_students'">跟进列表</li>
					<li data-options="url:'transfer_page',iconCls:'icon-recruit_students'">移交列表</li>
					<li data-options="url:'sign_student',iconCls:'icon-recruit_students'">签约列表</li>
					<li data-options="url:'report_from',iconCls:'icon-recruit_students'">招生统计</li>
				</ul>
			</div>
			<div title="财务管理" data-options="iconCls:'icon-shoukuan'"
				style="overflow: auto; padding: 2px;">
				<ul id="menu-cw" class="easyui-tree">
					<li data-options="url:'payrecord',iconCls:'icon-payrecord'">收款管理</li>
					<li data-options="url:'payback',iconCls:'icon-payback'">退款管理</li>
					<li data-options="url:'tuition',iconCls:'icon-student_tuition'">学费信息</li>
					<li data-options="url:'tongji',iconCls:'icon-student_tuition'">财务统计</li>
				</ul>
			</div>
			<div title="教学管理" data-options="iconCls:'icon-teaching'"
				style="overflow: auto; padding: 2px;">
				<ul id="menu-jx" class="easyui-tree">
					<li data-options="url:'class_',iconCls:'icon-class'">班级管理</li>
					<li data-options="url:'bedroom',iconCls:'icon-bedroom'">寝室列表</li>
					<li data-options="url:'outline',iconCls:'icon-exce'">习题管理</li>
					<li
						data-options="url:'publish_exercises',iconCls:'icon-publish_exce'">生成练习</li>
					<li data-options="url:'marking_work',iconCls:'icon-publish_exce'">批阅习题</li>
					<li data-options="url:'project_manage',iconCls:'icon-publish_exce'">项目管理</li>
					<li data-options="url:'project_plan',iconCls:'icon-publish_exce'">项目计划</li>
				</ul>
			</div>
			<div title="就业管理" data-options="iconCls:'icon-jiuye'"
				style="overflow: auto; padding: 2px;">
				<ul id="menu-jy" class="easyui-tree">
					<li data-options="url:'graduation'">毕业审核</li>
					<li data-options="url:'teaemployment'">就业学员</li>
					<li data-options="url:'resume'">简历管理</li>
					<li data-options="url:'database'">面试记录</li>
					<li data-options="url:'teaemploy/getcount'">就业统计</li>
				</ul>
			</div>
			<div title="关系维护" data-options="iconCls:'icon-guanxi'"
				style="overflow: auto; padding: 2px;">
				<ul id="menu-gx" class="easyui-tree">
					<li data-options="url:'student_information',iconCls:'icon-student_message'">归档信息</li> 
					<li data-options="url:'maintenance',iconCls:'icon-weihujilu'">维护记录</li>
					<li data-options="url:'new_technology',iconCls:'icon-technology'">新兴技术</li>
					<li data-options="url:'student_list',iconCls:'icon-student_journey'">学员历程</li>
				</ul>
			</div>
		</div>


	</div>
	<!--内容-->
	<div data-options="region:'center'" border="false">
		<div id="tabs" class="easyui-tabs" fit="true" >
			<div title="主页" class="layout" style="overflow: scroll;"> 
				<div class="topdiv">
				
					<div class="fourthdiv">
						<div class="fourthimg">
							<img src="public/images/statistics.png" >
						</div>
						<div class="fourthtxt">
							<span class="number">${workcount}</span>
							<span class="titles">今日提交作业</span>
						</div>
					</div>
				
					
					<div class="seconddiv">
						<div class="secondimg">
							<img src="public/images/collection.png" >
						</div>
						<div class="secondtxt">
							<span class="number">${jkcount }</span>
							<span class="titles">本月缴费人数</span>
						</div>
					</div>
					
					<div class="firstdiv"> 
						<div class="firstimg">
							<img src="public/images/admissions.png" >
						</div>
						<div class="firsttxt">
							<span class="number">${zscount}</span>
							<span class="titles">今年招生人数</span>
						</div>
					</div>
			
					
					<div class="thirddiv">
						<div class="thirdimg">
							<img src="public/images/employment.png" >
						</div>
						<div class="thirdtxt">
							<span class="number">${bycount }</span>
							<span class="titles">今年毕业人数</span>
						</div>
					</div>
				</div>
			
				<div class="bodydiv">
					<!-- 顶部 -->
					<div class="divtop">
						<span class="timeline">Using the process</span>
						<span class="timelinetxt">This is a system management process</span>
					</div> 
					
					<!-- 左边 -->
					<div class="leftdiv">
					
						<!-- 左边第一个 -->
						<div class="leftdialog">
							<div class="lefttool">
								<span class="lefttitle">First step</span>
								<span class="lefttxt"><span class="strongtfour">招生管理</span>打开<span class="strongtthree" >全部咨询</span>，点击<span class="strong">添加学员</span>录入学生信息</span>
							</div>
							
							<div class="leftsmall">
							</div>
						</div>
						
						<!-- 左二 -->
						<div class="leftblank"> </div>
						
						<!-- 左三 -->
						<div class="leftdialog">
							<div class="lefttool">
								<span class="lefttitle">Third step</span>
								<span class="lefttxt"><span class="strongtfour">财务管理</span>打开<span class="strong">招生管理</span>，<span class="strong">录入收款记录</span></span>
							</div>
							
							<div class="leftsmall"> </div>
						</div>
						
						<!-- 左四 -->
						<div class="leftblank">
						
						</div>
						
						<!-- 左五 -->
						<div class="leftdialog">
							<div class="lefttool">
								<span class="lefttitle">Fifth step</span>
								<span class="lefttxt"><span class="strongtthree">教学管理</span>打开<span class="strongtfour">习题管理</span>添加试题，生产练习、批阅练习</span>
							</div>
							
							<div class="leftsmall"> </div>
						</div>
						
						<!-- 左六-->
						<div class="leftblank">
						
						</div>
						
						<div class="leftdialog">
							<div class="lefttool">
								<span class="lefttitle">Seventh step</span>
								<span class="lefttxt"><span class="strongtfour">关系维护</span>打开<span class="strongtthree">维护记录</span>添加维护记录，<span class="strong">新兴技术</span>上传技术</span>
							</div>
							
							<div class="leftsmall"> </div>
						</div>
					</div>
					
					<!-- 右边 -->
					<div class="rightdiv">
						<!-- 右边第一个 -->
						<div class="rightblank">
						
						</div>
						
						<!-- 右二 -->
						<div class="rightdialog">
							<div class="rightsmall">
							</div>
						
							<div class="righttool">
								<span class="righttitle">Second step</span>
								<span class="righttxt"><span class="strongtthree">招生管理</span>分配学员给咨询师进行<span class="strongtwo">跟进、签约</span>或者<span class="strongtfour">移交</span></span>
							</div>
						</div>
						
						<!-- 右三 -->
						<div class="rightblank">
						
						</div>
						
						<!-- 右四 -->
						<div class="rightdialog">
							<div class="rightsmall">
							</div>
						
							<div class="righttool">
								<span class="righttitle">Fourth step</span>
								<span class="righttxt"><span class="strongtthree">教学管理</span>打开<span class="strongtthree">班级管理</span>分配班级，然后打开<span class="strongtwo">寝室管理</span>分配寝室</span>
							</div>
						</div>
						
						<!-- 右五 -->
						<div class="rightblank">
						
						</div>
						
						<!-- 右六 -->
						<div class="rightdialog">
							<div class="rightsmall">
							</div>
						
							<div class="righttool">
								<span class="righttitle">Sixth step</span>
								<span class="righttxt"><span class="strongtwo">就业管理</span>打开<span class="strongtthree">毕业审核</span>然后添加<span class="strongtwo">简历</span>和<span class="strongtfour">面试记录</span></span>
							</div>
						</div>
					</div>
					
				</div>
			</div>
		</div>
	</div>
	<div id="mm" class="easyui-menu" style="width: 150px;">
		<div id="mm-tabclose" name="6">刷新</div>
		<div id="Div1" name="1">关闭</div>
		<div id="mm-tabcloseall" name="2">全部关闭</div>
		<div id="mm-tabcloseother" name="3">除此之外全部关闭</div>
		<div class="menu-sep"></div>
		<div id="mm-tabcloseright" name="4">当前页右侧全部关闭</div>
		<div id="mm-tabcloseleft" name="5">当前页左侧全部关闭</div>
	</div>
</body>
<!-- js文件，顺序：jq，easyui，国际化包 -->
<script src="public/js/jquery.min.js"></script>
<script src="public/easyui/jquery.easyui.min.js"></script>
<script src="public/easyui/locale/easyui-lang-zh_CN.js"></script>
<script type="text/javascript" src="public/js/highcharts.js"></script>
<script type="text/javascript" src="public/js/score.js"></script>
<script src="public/js/drilldown.js"></script>
<script src="public/easyui/themes/bootstrap/insdep/jquery.insdep-extend.min.js"></script>
<script src="public/js/main_onclick.js"></script>
<script src="public/js/datagrid-detailview.js"></script>
<script type="text/javascript" src="public/js/score.js"></script>

<script>

$("#homepage").on("click",function(){
	location.reload();
});

$("#wodexiaoxi").on("click",function(){
	myMessage();
	
});
function myMessage() {
	// 创建窗口
	var dialog = $("<div/>").dialog({
		href:"my_massage",
		title: "我的消息",
		height: 400,
		iconCls: 'icon-tip',
		width: 800,
		modal: true,
		onClose: function() {	
			$.post("payrecord/close", function(rs) {	
				$.get("index", function() {	
					$("#wdxx").html("0");
				});
			});		
			$(this).dialog("destroy");
		} 

	});
}

$("#yjmassage").on("click",function(){
	massageForm();
});
function massageForm(){
	// 创建窗口
	var dialog = $("<div/>").dialog({
		href : 'student/transfer_massage',
		title:"我的提醒",
		height:380,
		width:790,
		modal : true,
		onClose : function() {
			// 窗口关闭的同时销毁此窗口
			$(this).dialog("destroy");
			//刷新
			$.get("index", function() {	
				window.location.reload();
			});	
		}
	});
}
$(function() {
	$.ajaxSetup({
		statusCode : {
			401 : function() {
				//当ajax请求的响应码为401的时候，将执行此方法
				window.location.href = "/login";
			}
		}
	});
	$("#exit").on("click", function() {
		$.messager.confirm('退出系统', '您真的要退出吗？', function(r) {
			if (r) {
				window.location.href = "/logout";
			}
		});
	});
	
	$("#changePassword").on("click",function(){
		var userid = $("#userid").val();	
		changepass(userid);
	});
	function changepass(userid) {
		// 创建窗口
		var dialog = $("<div/>").dialog({
			href : "emp/changepassword"+ (userid ? ("/" + userid) : ""),
			title : "修改密码",
			height : 340,
			width : 360,
			modal : true,
			onClose : function() {
				$(this).dialog("destroy");
			},
			buttons : [ {
				iconCls : 'icon-save',
				text : '确定',
				align : 'center',
				handler : function() {
					//原始的密码
					var oldpass = $("#oldpassword").val();
					//当前输入的密码
					var curpassword = $("#currentpassword").val();
					//新密码
					var pass = $("#pass").val();
					//确定新密码
					var newpass = $("#newpass").val();
					if(oldpass==curpassword){
						if(oldpass != pass){
							if(pass==newpass){
										$.messager.confirm('修改密码', '修改之后需要重新登录，是否修改？', function(r) {
											if (r) {
											$("#changePasswordForm").form('submit', {						
					                        url: 'emp/changeuserpass',                    
					                        data: $("#changePasswordForm").serialize(),success:function(success) {
					                        	if(success){
					            					//重新登录
					                        		window.location.href = "/logout";
					    							
					                        	}else{
					                        		$.messager.alert("提示",rs.message);
					                        	}
					                        }
					                    });
									   }
									});
							}else{
								$.messager.alert("输入有误","输入的两次新密码不一致，请重新输入");
							}
						}else{
							$.messager.alert("输入有误","新密码不能和旧密码相同，请重新输入");
						} 
				}else{
					$.messager.alert("输入有误","原始密码有误，请重新输入");
				}
			}
			}]
		});
	}
	$("#edituser").on("click",function(){
		var userid = $("#userid").val();
		edituser(userid);
	});
	function edituser(userid) {
		
		// 创建窗口
		var dialog = $("<div/>").dialog({
			href : "/emp/"+'edituser?id=' + userid,
			title : "修改用户信息",
			height : 300,
			width : 450,
			modal : true,
			onClose : function() {
				$(this).dialog("destroy");
			},
			buttons : [ {
				iconCls : 'icon-save',
				text : '确定',
				align : 'center',
				handler : function() {
					
					$.messager.confirm('修改账户', '修改之后需要重新登录，确定修改吗？', function(r) {
						if (r) {
							$("#edituserForm").form('submit', {						
	                        url: 'emp/saveuser',                    
	                        data: $("#edituserForm").serialize(),success:function(success) {
	                        	if(success){
	                        		
	            					//重新登录
	                        		window.location.href = "/logout";

	                        	}
	                        }
	                    });
					}
				}); 
					
			}
			}]
		});
	}
});
</script>
</html>